package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * CompanyMember entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_COMPANY_MEMBER", schema = "HCD_DEV")
public class CompanyMember extends Entity implements java.io.Serializable {

	// Fields

	private CompanyMemberId id;
	private Member member;
	private Company company;
	private Long addTime;

	// Constructors

	/** default constructor */
	public CompanyMember() {
	}

	/** full constructor */
	public CompanyMember(CompanyMemberId id, Member member, Company company, Long addTime) {
		this.id = id;
		this.member = member;
		this.company = company;
		this.addTime = addTime;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "companyId", column = @Column(name = "COMPANY_ID", nullable = false, precision = 15, scale = 0)),
			@AttributeOverride(name = "memberId", column = @Column(name = "MEMBER_ID", nullable = false, precision = 15, scale = 0)) })
	public CompanyMemberId getId() {
		return this.id;
	}

	public void setId(CompanyMemberId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEMBER_ID", nullable = false, insertable = false, updatable = false)
	public Member getMember() {
		return this.member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COMPANY_ID", nullable = false, insertable = false, updatable = false)
	public Company getCompany() {
		return this.company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

}